﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Web.Security;

namespace Amkeni_System
{
    public partial class DeveloperSite : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //adding some code to page load to determine which should be the selected item:

            string path = Request.AppRelativeCurrentExecutionFilePath;
            foreach (MenuItem item in MainMenu.Items)
            {
                item.Selected = item.Value.Equals(path, StringComparison.InvariantCultureIgnoreCase);
            }

            /*string path = Request.Url.AbsoluteUri;
            foreach (MenuItem item in MainMenu.Items)
            {
                string myTest = System.IO.Path.GetFileName(item.NavigateUrl);
                if (path.Contains(myTest))
                {
                    item.Selected = true;
                }
            }*/
        }
    }
}